<template>
	<span class="count-up" ref="countUpRef">000,000.00</span>
</template>

<script lang="ts" setup>
import { CountUp } from 'countup.js';
import { ref } from 'vue';

const countUpRef = ref();

const start = (endVal: number) => {
	const countUp = new CountUp(countUpRef.value, endVal, {
		startVal: 0,
		decimalPlaces: 2,
		// plugin: new Odometer({ duration: 2.3, lastDigitDelay: 0 }),
		duration: 3
	});
	countUp.start();
};

defineExpose({
	start
});
</script>
